# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-xmlschema
pkgver=3.4.3
pkgrel=0
pkgdesc="XML schema validator and conversion library"
url="https://github.com/sissaschool/xmlschema"
arch="noarch"
license="MIT"
depends="py3-elementpath"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-jinja2"
options="net" # tests access xml.xsd from w3.org
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sissaschool/xmlschema/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/xmlschema-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ba32fec27580bfcf58b381f30c9d1415f43492852ca3adb6ab4be83f0ca4b07355049fbb9b795d3b2a3dd3094e6960f783914ad4400b3de520f46f296d94a345  py3-xmlschema-3.4.3.tar.gz
"
